<template>
  <h1>{{ msg }}||{{count}}</h1>

  <p>
    <a href="https://vitejs.dev/guide/features.html" target="_blank">Vite Documentation</a>
    |
    <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
  </p>

  <el-button @click="increment">count is: {{ count }}</el-button>
  <p>
    Edit
    <code>components/HelloWorld.vue</code> to test hot module replacement.
  </p>
</template>
<script>
// 测试是否兼容vue2.0语法
// result:可兼容
export default {
  props: ['msg'],
  data() {
    return {
      aaa: 1111
    }
  },
  methods: {
    increment() {
      this.$store.commit('increment')
      this.$bus.$emit('aa','aa')
    },

  },
  mounted () {
    this.$bus.$on('aa',(val) => console.log('val',val));
  },
  computed:{
    count() {
      return this.$store.state.count
    }
  }
}
</script>
<style scoped lang="scss">
p {
  a {
    color: #42b983;
  }
}
</style>
